home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / templmac.zip / TEMPLATE.C < prev    next >
C/C++ Source or Header  |  1991-03-27  |  4KB  |  96 lines

  1. TEMPLATE.C: QEdit Language Template for C   (Follows K&R Second Edition).
  2.               (Top 20 lines are skipped)
  3. Last revised: 27-March-1991.   For use with "`" macro in TEMPLATE.QM.
  4.  
  5. Format is as follows:
  6.  
  7.       ■KEYWORD1                <---What you want to type
  8.       ###                      <---lines this text takes, minus 1
  9.       TEXT                     <---start of text to be inserted
  10.       etc
  11.       ■KEYWORD2                <---Next keyword to match
  12.       ###                      <---# of lines
  13.       TEXT                     <---
  14.       ...
  15.  
  16. Mandatory: CHR( 254 ) "■" precedes all keywords
  17. Optional:  CHR( 248 ) "°" marks cursor pos. in inserted text after insertion.
  18.  
  19. Anything between end of inserted text and next keyword is ignored, so you
  20. can include comments, etc.  We have put a line of dashes between each item.
  21. -----------------------------------------------------------------
  22. ■/*                                    COMMENT BLOCK
  23. 6 lines
  24. /*
  25. ****************************************************************
  26. *                                                              *
  27. *  °BLOCK COMMENT                                               *
  28. *                                                              *
  29. ****************************************************************
  30. */
  31. -----------------------------------------------------------------
  32. ■{                                     COMPOUND STATEMENT (BRACES)
  33. 1 line
  34. {  /* °block_comment */
  35. }  /* block_comment */
  36. -----------------------------------------------------------------
  37. ■SWITCH                                SWITCH STATEMENT  (K&R p.58)
  38. 4 lines
  39. switch ( °expr ) {
  40.     case const_expr :
  41.     case const_expr :
  42.     default :
  43. };  /* switch expr */
  44.  
  45. NOTE:  K&R is inconsistent with itself on indenting "case" lines.
  46.        Compare the fragments on p.58 & p.59 for an example.
  47. -----------------------------------------------------------------
  48. ■FOR                                   FOR LOOP  (K&R p.224)
  49. 1 line
  50. for ( °expr1; expr2; expr3 ) {
  51. };  /* for expr */
  52. -----------------------------------------------------------------
  53. ■IF                                    IF STATEMENT  (K&R p.56)
  54. 3 lines
  55. if ( °expr ) {
  56. }   /* if expr */
  57. else {
  58. };  /* else */
  59.  
  60. NOTE:  K&R is also inconsistent here.  An example on p.108 would
  61.        indicate that "} else {" is the correct form for the second
  62.        and third lines of the above.
  63. -----------------------------------------------------------------
  64. ■ELSE                                  ELSE CLAUSE ONLY  (K&R p.56)
  65. 1 lines
  66. else {
  67. };  /* else */
  68. -----------------------------------------------------------------
  69. ■DO                                    DO - WHILE LOOP  (K&R p.224)
  70. 1 line
  71. do {
  72. } while ( °expr );
  73. -----------------------------------------------------------------
  74. ■WHILE                                 WHILE LOOP  (K&R p.224)
  75. 1 line
  76. while ( °expr ) {
  77. };  /* while expr */
  78. -----------------------------------------------------------------
  79. ■STRUCT                                STRUCTURE DEFINITION  (K&R p.128)
  80. 1 line
  81. struct °name {
  82. };
  83. -----------------------------------------------------------------
  84. ■UNION                                 UNION DEFINITION
  85. 1 line
  86. union °name {
  87. };
  88. -----------------------------------------------------------------
  89. ■MAIN                                  MAIN PROGRAM
  90. 2 lines
  91. void main ( °void )
  92. {
  93. }
  94. -----------------------------------------------------------------
  95. ***EOF: TEMPLATE.C***
  96.